package com.yuyou.fn.wx.service.impl;

import me.chanjar.weixin.common.api.WxConsts;
import me.chanjar.weixin.common.bean.menu.WxMenu;
import me.chanjar.weixin.common.bean.menu.WxMenuButton;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import java.util.Arrays;


@Service("customerWeixinService")
public class CustomerWeixinServiceImpl extends WeixinServiceImpl{

    @Value("${customer.wx.app.id}")
    private String wxAppId;

    @Value("${customer.wx.secret}")
    private String wxSecret;

    @Value("${customer.wx.token}")
    private String wxToken;


    @Override
    public WxMenu renderMenu() {
        WxMenu wxMenu = new WxMenu();
        WxMenuButton wxMenuButton = new WxMenuButton();
        wxMenuButton.setType(WxConsts.BUTTON_VIEW);
        wxMenuButton.setUrl("https://mkc.zy.com/courses/index/2/0/0/0/14-15-16/0/0/0/0?wechatRelatedCode=GzYyJykjYxgs");
        wxMenuButton.setName("课程报读");

        /*WxMenuButton wxMenuButton2 = new WxMenuButton();
        wxMenuButton2.setType(WxConsts.BUTTON_VIEW);
        wxMenuButton2.setUrl("http://s.y.yuyou100.com/recommend?_t=" + System.currentTimeMillis());
        wxMenuButton2.setName("续报");*/

        WxMenuButton wxMenuButton2 = new WxMenuButton();
        wxMenuButton2.setType(WxConsts.BUTTON_VIEW);
        wxMenuButton2.setUrl("https://h5-game.yuyou100.com/groupbuy01sp/#/?channel=yypx");
        wxMenuButton2.setName("反三科课程");

        WxMenuButton wxMenuButton3 = new WxMenuButton();
        wxMenuButton3.setType(WxConsts.BUTTON_VIEW);
        wxMenuButton3.setUrl("https://gzssh5.yuyou100.com");
        wxMenuButton3.setName("学生服务");

        wxMenu.setButtons(Arrays.asList(wxMenuButton,wxMenuButton2,wxMenuButton3));
        return wxMenu;
    }

    public String getWxAppId() {
        return wxAppId;
    }

    public String getWxSecret() {
        return wxSecret;
    }

    public String getWxToken() {
        return wxToken;
    }

    public String getWhich() {
        return "customer";
    }

}
